package chpt06;

import java.util.ArrayList;
import java.util.List;

public class StudentV5 {
	 private String sName;
	 private int sAge;
	 private List<Course> allCourses; // 定义List集合保存全部课程
	 // getter/setter代码
	 public String getsName() {
		return sName;
	}

	public void setsName(String sName) {
		this.sName = sName;
	}

	public int getsAge() {
		return sAge;
	}

	public void setsAge(int sAge) {
		this.sAge = sAge;
	}

	public List<Course> getAllCourses() {
		return allCourses;
	}

	public void setAllCourses(List<Course> allCourses) {
		this.allCourses = allCourses;
	}

	public StudentV5() {
		 this.allCourses = new ArrayList<Course>();
	}

	public StudentV5(String sName, int sAge) {
		this();  // 调用无参构造函数
		this.sName = sName;
		this.sAge = sAge;
	}
	// toString方法
	@Override
	public String toString() {
		return "学生姓名:" + this.sName + "; 年龄："+ this.sAge;
	}	 
}
